const int pingPin = 7;

void setup() {
  Serial.begin(9600);
}

void loop()
{
  float duration;
  float inches;

  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  inches = microsecondsToInches(duration);
  
  Serial.print(inches, DEC);
  Serial.print("in");
  Serial.println();
  
  delay(100);
}

double microsecondsToInches(float microseconds)
{
  return microseconds;// / 147.0;
}
